A modal calculus for effect handling

نویسنده

  • Aleksandar Nanevski
چکیده

In their purest formulation, monads are used in functional programming for two purposes: (1) to hygienically propagate effects, and (2) to globalize the effect scope – once an effect occurs, the purity of the surrounding computation cannot be restored. As a consequence, monadic typing does not provide very naturally for the practically important ability to handle effects, and there is a number of previous works directed toward remedying this deficiency. It is mostly based on extending the monadic framework with further extra-logical constructs to support handling. In this paper we adopt a different approach, founded on the observation of Pfenning and Davies that an abstract monad can be decomposed in terms of modal operators for possibility 3 and necessity . Our idea is to use the modality (which is a comonad) for hygienic propagation of effects, and leave the globalization of effect scope to 3. Then the effects which admit a natural notion of handling can be encoded using ; since they are not global, there is no need to push them under 3. Based on this idea, we develop a general framework for effect handling systems, and obtain novel calculi for exceptions, catch-and-throw and composable continuations as specific instantiations.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Compositional Proof Systems for Model Checking Infinite State Processes

We present the rst compositional proof system for checking processes against formulas in the modal-calculus which is capable of handling general innnite-state processes. The proof system is obtained in a systematic way from the operational semantics of the underlying process algebra. A non-trivial proof example is given, and the proof system is shown to be sound in general, and complete for nit...

متن کامل

Proving Properties of Dynamic Process Networks

We present the rst compositional proof system for checking processes against formulas in the modal -calculus which is capable of handling dynamic process networks. The proof system is obtained in a systematic way from the operational semantics of the underlying process algebra. A non-trivial proof example is given, and the proof system is shown to be sound in general, and complete for nite-stat...

متن کامل

A Modal Calculus for Exception Handling

The exception monad, while an adequate mechanism for providing the denotational semantics of exceptions, is somewhat awkward to program with. Just as any other monad, it forces a programming style in which exceptional computations are explicitly sequentialized in the program text. In addition, values of computation types must usually be tested before use, in order to determine if they correspon...

متن کامل

K-clusters Tableaux a Tool for Modal Logics and Inconsistent Belief Sets

The goal of this paper is to present a tableau calculus for propositional modal logics that is e ective for automated proof search, easy to use for proof presentation, and applicable to a wide range of modal logics for knowledge representation. The calculus is also enhanced to provide a form of contextual reasoning to deal with (classical) inconsistency. The basic tableau calculus (Single Step ...

متن کامل

Towards a Maude Tool forModel Checking Temporal Graph PropertiesThis work has been supported by the European project ASCENS

We present our prototypical tool for the verification of graph transformation systems. The major novelty of our tool is that it provides a model checker for temporal graph properties based on counterpart semantics for quantified μ-calculi. Our tool can be considered as an instantiation of our approach to counterpart semantics which allows for a neat handling of creation, deletion and merging in...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003